﻿using Microsoft.AspNetCore.Mvc;
using SportsPlatform.Base;
using SportsPlatform.Dto.SportBusiness.CompetitionRuleInfo;
using SportsPlatform.Dto.SportBusiness.Information;
using SportsPlatform.Filters;
using SportsPlatform.Query.SportBusiness.CompetitionRuleInfo;
using SportsPlatform.SportBusiness.ISportBusiness;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SportsPlatform.Controllers
{
    /// <summary>
    /// 比赛规则信息
    /// </summary>
    [ActionAuthorization]
    [Route("api/[controller]/[action]")]

    public class CompetitionRuleInfoController : SportsPlatformControllerBase
    {
        private ICompetitionRuleInfoService _service;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="service"></param>
        public CompetitionRuleInfoController(ICompetitionRuleInfoService service)
        {
            this._service = service;
        }
        /// <summary>
        /// 比赛规则信息列表
        /// </summary>
        /// <param name="Query"></param>
        [HttpPost]
        public async Task<PagePagingDto<CompetitionRuleInfoListDto>> GetCompetitionRuleInfoList([FromBody] GetCompetitionRuleInfoListQuery Query)
        {
            return await _service.GetCompetitionRuleInfoList(Query);
        }

        /// <summary>
        /// 添加比赛规则信息
        /// </summary>
        /// <param name="Query"></param>
        [HttpPost]
        public async Task<BaseResultDto> AddCompetitionRuleInfo([FromBody] AddCompetitionRuleInfoQuery Query)
        {
            return await _service.AddCompetitionRuleInfo(Query);
        }

        /// <summary>
        /// 比赛规则信息详情
        /// </summary>
        /// <param name="Query"></param>
        [HttpPost]
        public async Task<ResultDto<CompetitionRuleInfoDetailsDto>> CompetitionRuleInfoDetails([FromBody] GetCompetitionRuleInfoDetailsQuery Query)
        {
            return await _service.CompetitionRuleInfoDetails(Query);
        }

        /// <summary>
        /// 修改比赛规则信息
        /// </summary>
        /// <param name="Query"></param>
        [HttpPost]
        public async Task<BaseResultDto> UpdateCompetitionRuleInfo([FromBody] UpdateCompetitionRuleInfoQuery Query)
        {
            return await _service.UpdateCompetitionRuleInfo(Query);
        }

        /// <summary>
        /// 禁用启用比赛规则信息
        /// </summary>
        /// <param name="Query"></param>
        [HttpPost]
        public async Task<BaseResultDto> UpdateCompetitionRuleInfoEnableOrDisable([FromBody] UpdateCompetitionRuleInfoEnableOrDisableQuery Query)
        {
            return await _service.UpdateCompetitionRuleInfoEnableOrDisable(Query);
        }
    }
}
